-
Notifications
You must be signed in to change notification settings - Fork 0
feat(sdk): add linter and fix linter findings #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
relates to STACKITSDK-219
...manager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java
Outdated
Show resolved
Hide resolved
...ntication/src/main/java/cloud/stackit/sdk/authentication/examples/AuthenticationExample.java
Outdated
Show resolved
Hide resolved
...manager/src/main/java/cloud/stackit/sdk/resourcemanager/examples/ResourcemanagerExample.java
Outdated
Show resolved
Hide resolved
examples/iaas/src/main/java/cloud/stackit/sdk/iaas/examples/IaaSExample.java
Outdated
Show resolved
Hide resolved
...lient/src/main/java/cloud/stackit/sdk/customhttpclient/examples/CustomHttpClientExample.java
Outdated
Show resolved
Hide resolved
accessToken = getAccessToken(); | ||
} catch (ApiException | InvalidKeySpecException e) { | ||
throw new RuntimeException(e); | ||
throw new IllegalStateException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if a IllegalStateException
is correct here.
From https://docs.oracle.com/javase/8/docs/api/java/lang/IllegalStateException.html: "Signals that a method has been invoked at an illegal or inappropriate time. In other words, the Java environment or Java application is not in an appropriate state for the requested operation."
I think I also saw this in multiple places, so please also check if the IllegalStateException
is appropriate there.
// try-catch required, because ApiException can not be thrown in the implementation | ||
// of Interceptor.intercept(Chain chain) | ||
throw new RuntimeException(e); | ||
throw new IllegalStateException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
e.g. here
throw new RuntimeException(e); | ||
System.out.println(response.toString()); | ||
} catch (ApiException | IOException e) { | ||
throw new IllegalStateException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
|
||
} catch (ApiException | InterruptedException e) { | ||
throw new RuntimeException(e); | ||
throw new IllegalStateException(e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Description
relates to STACKITSDK-219
Checklist
make fmt
examples/
directory)make test
(will be checked by CI)make lint
(will be checked by CI)